package service;

import pojo.Note;

import java.sql.SQLException;

public interface NoteService {
    /**
     * 添加笔记
     *
     * @param note
     * @return
     * @throws SQLException
     */
    boolean addNote(Note note) throws SQLException;

    /**
     * 删除笔记
     *
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean deleteNote(Integer nid) throws SQLException;

    /**
     * 修改笔记
     *
     * @param nid
     * @param note
     * @return
     * @throws SQLException
     */
    boolean updateNote(Integer nid, Note note) throws SQLException;

    /**
     * 查找修改的笔记内容回显
     *
     * @param nid
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    Note findUpdateNote(Integer nid) throws SQLException, ClassNotFoundException;

    /**
     * 修改笔记通过权限
     *
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean passNote(Integer nid) throws SQLException;

    /**
     * 查询添加笔记的id
     *
     * @param note
     * @return
     * @throws SQLException
     */
    Integer findUserNoteNid(Note note) throws SQLException;

    /**
     * 笔记添加标签处理
     *
     * @param labels
     * @param userAddLabels
     * @param noteadd
     * @throws SQLException
     */
    void noteAddLabels(String[] labels, String[] userAddLabels, Note noteadd) throws SQLException;
}
